# 给定一个1-n的整数，判定里面有多少个1

def calc1(num):
    count = 0
    str_num = str(num)
    for i in str_num:
        if i == "1":
            count += 1
    return count


n = 100
num = 0
for i in range(n):
    num += calc1(i)

print(num)
